-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a function to allow writing old emails into the maildir #39
Conversation
I'm away at the moment, probably won't take a look at this for at least a week or so. Sorry for the wait |
Hi @williamdes , in looking at the PR I don't like the fact that this exposes more of maildir internals to the consumer. Stuff like tmp_file_path, tmp_file etc should be abstracted away as implementation detail but this makes it part of the public API. It's also not clear to me why this is needed. I looked at the PR you referenced in mail-server but it only calls
My interpretation of https://cr.yp.to/proto/maildir.html is that entries in |
This comment was marked as resolved.
This comment was marked as resolved.
The hostname is supposed to be an implementation detail of the uniqueness algorithm. As it says at https://cr.yp.to/proto/maildir.html (emphasis added):
It sounds like you intend to extract the hostname or other parameters from the filename in order to make this historical data "coherent", but that is violating the above. I'm ok with adding a function to indicate the subfolder to save in, because that is part of the maildir structure. But the filename details I'm not really ok with exposing without better justification.
Whether it's part of a struct or individually listed arguments doesn't make much difference, it would still be part of the API. |
This comment was marked as resolved.
This comment was marked as resolved.
But that's my point - the actual hostname used shouldn't really matter, it's just a way to get a unique value.
If you are considering the exact filename as semantically important then yes you are correct, that is not a goal of this crate. This crate is aimed at a higher level of abstraction, so the exported maildir would contain the same data in the same folder structure, but the filenames may be different. However no compliant tool should be able to observe a difference.
Why don't you use that crate then? |
What you need is a synchronizer, sth like OfflineIMAP or mbsync. If your goal was to learn or use Rust, then have a look at |
Okay, I guess that's it. Thank you for better explaining what are the bounds of this crate. Merci @soywod for pointing out some other crates to use
I did not find it on my first search ^^ Bye all, thank you for the talk 👋🏻 |
I used the following documents:
For the pull-request linked below I need to write historical data, this new functions allows to write such data
Note: the MailEntries next function is written in a way that emails that would be in new with flags can not be found.
I find this weird, is there a documented reason ?
See:
maildir/src/lib.rs
Lines 262 to 267 in 3546472
Ref: stalwartlabs/mail-server#600